﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:acl="clr-namespace:AC.AvalonControlsLibrary.Controls;assembly=Southridge.Controls" 
    xmlns:biz="clr-namespace:Southridge.Business;assembly=Southridge.Business"
    xmlns:view="clr-namespace:Southridge.View"
	xmlns:acl2="AC"
	mc:Ignorable="d"
	x:Class="Southridge.View.PreferencesEditor"
	x:Name="UserControl"
 
	d:DesignWidth="408" d:DesignHeight="328" xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" Height="320">
	<UserControl.Resources>

        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
               
            </ResourceDictionary.MergedDictionaries>



            <Style x:Key="RangeSliderStyle1" TargetType="{x:Type acl:RangeSlider}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type acl:RangeSlider}">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="*"/>
                                </Grid.RowDefinitions>
                                <StackPanel x:Name="PART_RangeSliderContainer" Orientation="Horizontal" 
							Height="{TemplateBinding Height}" >
                                    <RepeatButton x:Name="PART_LeftEdge" Style="{DynamicResource RepeatButtonStyle1}"/>
                                    <Thumb Cursor="SizeWE" x:Name="PART_LeftThumb" Style="{DynamicResource ThumbStyle1}"/>
                                    <Thumb Cursor="ScrollAll" MinWidth="10" x:Name="PART_MiddleThumb" Background="Green"/>
                                    <Thumb Cursor="SizeWE" x:Name="PART_RightThumb" Style="{DynamicResource ThumbStyle1}"/>
                                    <RepeatButton x:Name="PART_RightEdge" Style="{DynamicResource RepeatButtonStyle1}" />
                                </StackPanel>

                                <TextBlock x:Name="PART_StartText" Grid.Row="1" HorizontalAlignment="Left" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RangeStartSelected, Mode=TwoWay}" />
                                <TextBlock x:Name="PART_StopText" Grid.Row="1" HorizontalAlignment="Right" Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=RangeStopSelected, Mode=TwoWay}"/>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="ThumbStyle1" TargetType="{x:Type Thumb}">
                <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
                <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Thumb}">
                            <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                                <Grid Background="#00000000">
                                    <Path Stretch="Fill" Stroke="#FF000000"  VerticalAlignment="Stretch" Data="M-1.0486111,10.430898 L9.5121528,10.430897 3.375,19.79 z" Margin="0,0,0,0" Fill="#FFF30B0B"/>
                                    <!-- <Border Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" BorderThickness="0,0,1,1"/>
								<Border Margin="1" Background="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" BorderThickness="0,0,1,1"/>
								<Border Margin="2" Background="{TemplateBinding Background}"/> -->

                                </Grid>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="ButtonFocusVisual">
                <Setter Property="Control.Template">
                    <Setter.Value>
                        <ControlTemplate>
                            <Rectangle Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="2" SnapsToDevicePixels="true"/>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
                <GradientStop Color="#F3F3F3" Offset="0"/>
                <GradientStop Color="#EBEBEB" Offset="0.5"/>
                <GradientStop Color="#DDDDDD" Offset="0.5"/>
                <GradientStop Color="#CDCDCD" Offset="1"/>
            </LinearGradientBrush>
            <SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>
            <Style x:Key="BaseButtonStyle" TargetType="{x:Type ButtonBase}">
                <Setter Property="FocusVisualStyle" Value="{DynamicResource ButtonFocusVisual}"/>
                <Setter Property="Background" Value="{DynamicResource ButtonNormalBackground}"/>
                <Setter Property="BorderBrush" Value="{DynamicResource ButtonNormalBorder}"/>
                <Setter Property="BorderThickness" Value="1"/>
                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
                <Setter Property="HorizontalContentAlignment" Value="Center"/>
                <Setter Property="VerticalContentAlignment" Value="Center"/>
                <Setter Property="Padding" Value="1"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ButtonBase}">
                            <Grid Background="Transparent" />
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="RepeatButtonStyle1" BasedOn="{DynamicResource BaseButtonStyle}" TargetType="{x:Type RepeatButton}">
                <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
            </Style>
            <Style x:Key="Heading3" TargetType="{x:Type TextBlock}">
                <Setter Property="TextWrapping" Value="NoWrap"/>
                <Setter Property="TextTrimming" Value="None"/>
                <Setter Property="Foreground" Value="#FF2564AB"/>
                <Setter Property="FontSize" Value="14"/>
                <Setter Property="HorizontalAlignment" Value="Left" />

            </Style>

             
            
        </ResourceDictionary>
    </UserControl.Resources>

	<Grid x:Name="LayoutRoot">
		<StackPanel Margin="0,0,0,3"  >
            <HeaderedContentControl Margin="4,0,0,8" Header="Location" Style="{DynamicResource GroupH1}">
                <Grid  Height="Auto">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width=".2*"/>
                        <ColumnDefinition Width=".4*"/>
                        <ColumnDefinition Width=".4*"/>
                    </Grid.ColumnDefinitions>
                    <StackPanel  Grid.Row="1" HorizontalAlignment="Stretch" Width="Auto" Grid.Column="0"  VerticalAlignment="Bottom" Margin="0,0,10,4">                        
                        <!--MAB CHANGE <ComboBox x:Name="State" Tag="State" IsEditable="False" 
                                  ItemsSource="{x:Static biz:FilterMetadata.States}" 
                                  DisplayMemberPath="ID"
                                  SelectedItem="{Binding Preference.State}"/>-->
                        <ComboBox x:Name="State" Tag="State" IsEditable="False" 
                                  
                                  DisplayMemberPath="ID"
                                  SelectedItem="{Binding Preference.State}"/>

                    </StackPanel>
                    <StackPanel Grid.Row="1" HorizontalAlignment="Stretch" Width="Auto" Grid.Column="1"   VerticalAlignment="Bottom" Margin="0,0,10,4">
                         
                    <ComboBox x:Name="County" IsEditable="False" Tag="County"  
                              ItemsSource="{Binding Preference.State.County}"  DisplayMemberPath="Name"
                              SelectedItem="{Binding Preference.County}" IsEnabled="{Binding IsCountyEnabled}"
                              />
                    </StackPanel>
                    <StackPanel  Margin="0,0,10,4" Grid.Row="1" Grid.Column="2"   VerticalAlignment="Bottom">                         
                        <ComboBox x:Name="Neighborhood" IsEditable="False" Tag="Neighborhood" DisplayMemberPath="Name"
                            ItemsSource="{Binding Preference.County.Neighborhood}" IsEnabled="{Binding IsNeighborhoodEnabled}"
                                  SelectedItem="{Binding Preference.Neighborhood}" />                                                
                    </StackPanel>
                </Grid>
            </HeaderedContentControl>
            
            <HeaderedContentControl Margin="4,0,0,4" Header="Property Type" Style="{DynamicResource GroupH1}">
                
                <UniformGrid Columns="3">                     
                    <CheckBox Content="Single Family" IsChecked="{Binding IsSingleFamilySelected}" Margin="5,0,0,5" />
                    <CheckBox Content="Multi Family" IsChecked="{Binding IsMultiFamilySelected}" Margin="5,0,0,5" />
                    <CheckBox Content="Condominium" IsChecked="{Binding IsCondominiumSelected}" Margin="5,0,0,5" />
                    <CheckBox Content="Townhome" IsChecked="{Binding IsTownHomeSelected}" Margin="5,0,0,5" />
                    <CheckBox Content="Land" IsChecked="{Binding IsLandSelected}" Margin="5,0,0,5" />
                    <CheckBox Content="Commercial" IsChecked="{Binding IsCommercialSelected}" Margin="5,0,0,5" />                    
                </UniformGrid>
                <!--<ItemsControl ItemTemplate="{DynamicResource CheckboxDataTemplate}" ItemsSource="{x:Static biz:FilterMetadata.PropertyTypes}" > 
                    <ItemsControl.Resources>
                        <DataTemplate x:Key="CheckboxDataTemplate">
                            <CheckBox Content="{Binding}" Margin="5,0,0,5" />
                        </DataTemplate>
                    </ItemsControl.Resources>
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <UniformGrid IsItemsHost="True" Margin="0,4,8,8" Columns="4"/>
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                </ItemsControl>-->                
            </HeaderedContentControl>    
            <HeaderedContentControl Margin="4,0,0,4" Header="Property Details" Style="{DynamicResource GroupH1}">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <ComboBox x:Name="SquareFootage" Grid.Column="0" Margin="4,2,4,2"
                              Grid.ColumnSpan="2" IsEditable="False" Tag="Square Feet" 
                              ItemsSource="{x:Static biz:FilterMetadata.SquareFootage}" 
                              SelectedItem="{Binding Preference.SquareFootage}" /> 
                          
                    <ComboBox x:Name="MinRooms" Grid.Row="0" Grid.Column="2" Margin="4,2,4,2" IsEditable="False" Tag="Bed rooms" ItemsSource="{x:Static biz:FilterMetadata.Rooms}" SelectedItem="{Binding Preference.MinRooms}"/>
                    <ComboBox x:Name="MinBaths" Grid.Row="0" Grid.Column="3" Margin="4,2,4,2" IsEditable="False" Tag="Bath rooms" ItemsSource="{x:Static biz:FilterMetadata.BathRooms}" SelectedItem="{Binding Preference.MinBaths}" />
                    <ComboBox x:Name="Yearsold" Grid.Row="0" Grid.Column="4" Margin="4,2,4,2" Grid.ColumnSpan="2" IsEditable="False" Tag="Years Old" ItemsSource="{x:Static biz:FilterMetadata.PropertyAge}" SelectedItem="{Binding Preference.YearBuilt}" />

                    <ComboBox x:Name="Acreage" Grid.Row="1" Grid.Column="0" Margin="4,2,4,2" Grid.ColumnSpan="2" IsEditable="False" Tag="Acreage" ItemsSource="{x:Static biz:FilterMetadata.Acreage}" SelectedItem="{Binding Preference.Acreage}"/>
                    <ComboBox x:Name="MinGarage" Grid.Row="1" Grid.Column="2" Margin="4,2,4,2" Grid.ColumnSpan="1" IsEditable="False" Tag="Garage" ItemsSource="{x:Static biz:FilterMetadata.Garage}" SelectedItem="{Binding Preference.MinGarage}"/>
                    
                    <CheckBox x:Name="View"  Margin="4,2,4,2" VerticalAlignment="Center"  Content="View"  IsChecked="{Binding Preference.HasView}" Grid.Row="1" Grid.Column="3"/>
                    <CheckBox x:Name="Waterfront" Margin="4,2,4,2" VerticalAlignment="Center" Content="WaterFront" IsChecked="{Binding Preference.HasWaterFront}" Grid.Row="1" Grid.Column="4" Grid.ColumnSpan="2"/>                    
                    
                     
                </Grid>             
			</HeaderedContentControl>
			
		</StackPanel>		
	</Grid>
</UserControl>